
import { defineAmisPlugin, getApiTpl, getInputTpl } from '../../base/util';
import CommonTask, { type IProps } from './fc';

export default defineAmisPlugin<IProps>(({ amisEditor }) => {
  const { getSchemaTpl } = amisEditor;

  return {
    component: CommonTask,
    options: {
      type: 'portal-common-task',
      name: '文字列表',
      order: 10,
      icon: 'UnorderedListOutlined',
      description: '文字列表',
      panelTitle: '文字列表面板',
      scaffold: {
        title: '文字列表'
      },
      panelTabs: [
        {
          title: '常规',
          body: [
            getSchemaTpl('collapseGroup', [
              {
                title: '基本',
                body: [
                  getInputTpl('title', { label: '标题' }),
                ]
              },
              getApiTpl()
            ])
          ]
        },
        {
          title: '外观',
          body: [
            getSchemaTpl('collapseGroup', [
              ...getSchemaTpl('theme:common', { styleName: 'style' })
            ])
          ]
        }
      ]
    }
  };
});
